//Replication data for Shelef, Nadav; Jamison, Anne, 2024, "Replication Data for: Domestic legitimacy, coethnics abroad, and the shape of the homeland", https://doi.org/10.7910/DVN/FWK7IN, Harvard Dataverse

//This do-file replicates all Cox models in the appendix, except Figures A.1 and A.2, which require a different configuration of the data. Please find the code for those two figures in a separate do-file.

//Computed on Stata 17.0 SE

//load data
use "cox data.dta"


**********
**********
//Table 1: Descriptive statistics
**********
**********

sutex2 mid_current priormid coethnic_presence_tek_mod poly_binary_dem1other0 ln_losingstate_exclpop gdpgrowth100  econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile regimeage_Vdem if potato_any_ModifiedEPR ==1 & colony==0, caption(Descriptive statistics) tablabel(tab:descriptive) varlabels minmax  sav(sumstat.tex) replace


***********
***********
//Table A.2: Risk of applying homeland territoriality to lost lands
***********
***********

stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

//REGIME TYPE

***//Regime type -- Main result 

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_aut
 estimates save "main_aut", replace
 
 ***//Proportion excluded -- Main result 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_eth
 estimates save "main_eth", replace
 
 ***//GDP -- Main result 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
*estat phtest, rank detail

*TVC needed (.1): regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc( regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_gdp
 estimates save "main_gdp", replace
 
 
***********
***********
*See separate do-file for code to Figure A.1
***********
***********
 


***********
***********
//Table A.3: Endogeneity: Regime type
***********
***********


stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

//REGIME TYPE

***//Regime type -- Main result 

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_aut
 estimates save "main_aut", replace


***//Regime type -- Group size 

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem sum_tek_group_size_gain, shared(id) forceshared efron
estat phtest, rank detail


*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem sum_tek_group_size_gain, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo sum_tek_group_size_gain_aut
 estimates save "sum_tek_group_size_gain_aut", replace
 
***//Regime type -- historical elf (efindex)

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem efindex, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):   priormid econ_value_all   regimeage_Vdem efindex  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem efindex, tvc(priormid econ_value_all   regimeage_Vdem efindex  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo EFIndex_nodecol
 estimates save "EFIndex_nodecol", replace

***//Regime type -- Historical ELF sq. 

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem efindex efindex_squared, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):   priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all   regimeage_Vdem efindex efindex_squared  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem efindex efindex_squared, tvc(priormid econ_value_all   regimeage_Vdem efindex efindex_squared  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo EFIndex2_nodecol
 estimates save "EFIndex2_nodecol", replace

***//Regime type -- Polarization 

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem actv_groups_count_fill , shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): prio econ cincrat_updtd_clclpwr capital_distance_ln actv_groups_count_fill strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem actv_groups_count_fill, tvc(priormid econ_value_all cincrat_updtd_clclpwr capital_distance_ln actv_groups_count_fill strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron
 eststo eprpolar_nodecol
 estimates save "eprpolar_nodecol", replace

***//Regime type -- State capacity 

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem statecapacitycomprehensive , shared(id) forceshared efron
estat phtest, rank detail

//tvc needed: priormid cincrat_updtd_clclpwr capital_distance_ln regimeage_Vdem

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem statecapacitycomprehensive, tvc(priormid cincrat_updtd_clclpwr capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron
 eststo cap_nodecol
 estimates save "cap_nodecol", replace


***//Regime type -- New state

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem new_state_5_lose, shared(id) forceshared efron

estat phtest, rank detail


*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem new_state_5_lose, tvc(priormid econ_value_all capital_distance_ln regimeage_Vdem strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron
eststo newstate_nodecol
estimates save "newstate_nodecol", replace

***//Regime type -- Clientelistic states 

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem v2xnp_client, shared(id) forceshared efron
estat phtest, rank detail

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem v2xnp_client, tvc(priormid econ_value_all cincrat_updtd_clclpwr  regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo clientelistic_nodecol
estimates save "clientelistic_nodecol", replace

***//Regime type -- Clients of same superpower 

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile ClientRelation3 strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile ClientRelation3 strata2 strata3 strata4up regimeage_Vdem, tvc(priormid econ_value_all capital_distance_ln  regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo CR3_nodecol
estimates save "CR3_nodecol", replace

***//Regime type -- Clients of opposing superpowers
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile ClientRelation4 strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile ClientRelation4 strata2 strata3 strata4up regimeage_Vdem, tvc(priormid econ_value_all capital_distance_ln ClientRelation4 regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo CR4_nodecol
estimates save "CR4_nodecol", replace


***//Regime type -- US client
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile USClient1 strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron

estat phtest, rank detail

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile USClient1 strata2 strata3 strata4up regimeage_Vdem, tvc(priormid econ_value_all capital_distance_ln USClient1 regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo USClient_nodecol
estimates save "USClient_nodecol", replace

***//Regime type -- Soviet client
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile SovietClient1 strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron

estat phtest, rank detail

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile SovietClient1 strata2 strata3 strata4up regimeage_Vdem, tvc(priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo Soviet_nodecol
estimates save "Soviet_nodecol", replace



***********
***********
//Table A.4: Endogeneity: Proportion excluded
***********
***********

stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

***//Proportion excluded -- Main result 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_eth
 estimates save "main_eth", replace

***//Proportion excluded -- Group size 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem sum_tek_group_size_gain, shared(id) forceshared efron
estat phtest, rank detail


*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem sum_tek_group_size_gain strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem sum_tek_group_size_gain, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem sum_tek_group_size_gain  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo sum_tek_group_size_gain_eth
 estimates save "sum_tek_group_size_gain_eth", replace

***//Proportion excluded -- historical elf (efindex)


stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem efindex, shared(id) forceshared efron
estat phtest, rank detail

 
*TVC needed (.1):   priormid    regimeage_Vdem efindex  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem efindex, tvc(priormid  regimeage_Vdem efindex  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo EFIndex_nodecol_excperln_ws
 estimates save "EFIndex_nodecol_excperln_ws", replace

***//Proportion excluded -- Historical ELF sq. 

 stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem efindex efindex_squared, shared(id) forceshared efron
estat phtest, rank detail

 *TVC needed (.1):   priormid cincrat_updtd_clclpwr regimeage_Vdem efindex efindex_squared
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem efindex efindex_squared, tvc(priormid cincrat_updtd_clclpwr regimeage_Vdem efindex efindex_squared) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo EFIndex2_nodecol_excperln_s
 estimates save "EFIndex2_nodecol_excperln_s", replace

***//Proportion excluded -- Polarization 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem actv_groups_count_fill , shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid cincrat_updtd_clclpwr capital_distance_ln actv_groups_count_fill strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem actv_groups_count_fill, tvc(priormid cincrat_updtd_clclpwr capital_distance_ln actv_groups_count_fill strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron
 eststo eprpolar_nodecol_excln
 estimates save "eprpolar_nodecol_excln", replace

***//Proportion excluded -- State capacity 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem statecapacitycomprehensive , shared(id) forceshared efron
estat phtest, rank detail

*tvc needed: priormid capital_distance_ln regimeage_Vdem

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem statecapacitycomprehensive, tvc(priormid capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron
 eststo cap_nodecol_excln
 estimates save "cap_nodecol_excln", replace

***//Proportion excluded -- New state

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem new_state_5_lose, shared(id) forceshared efron
estat phtest, rank detail
 

*TVC needed (.1): priormid   capital_distance_ln regimeage_Vdem new_state_5_lose strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem new_state_5_lose, tvc(priormid   capital_distance_ln regimeage_Vdem new_state_5_lose strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron
eststo newstate_nodecol_excperln
estimates save "newstate_nodecol_excperln", replace

***//Proportion excluded -- Clientelistic states 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem v2xnp_client, shared(id) forceshared efron

*estat phtest, rank detail

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem v2xnp_client, tvc(priormid capital_distance_ln    regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo clientel_nodecol_excperln
estimates save "clientel_nodecol_excperln", replace

***//Proportion excluded -- Clients of same superpower 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem ClientRelation3, shared(id) forceshared efron
estat phtest, rank detail
 

*TVC needed (.1): priormid econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile regimeage_Vdem  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem ClientRelation3, tvc(priormid econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo client3_nodecol_excperln
estimates save "client3_nodecol_excperln", replace

***//Proportion excluded -- Clients ofopposing superpowers

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem ClientRelation4, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all cincrat_updtd_clclpwr capital_distance_ln  regimeage_Vdem  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem ClientRelation4, tvc(priormid econ_value_all cincrat_updtd_clclpwr capital_distance_ln  regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo client4_nodecol_excperln
estimates save "client4_nodecol_excperln", replace


***//Proportion excluded --  US client 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem USClient1, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem USClient1 strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem USClient1, tvc(priormid econ_value_all capital_distance_ln regimeage_Vdem USClient1 strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo usclient_nodecol_excperln
estimates save "usclient_nodecol_excperln", replace
 

***//Proportion excluded -- Soviet client  

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem SovietClient1, shared(id) forceshared efron
estat phtest, rank detail


*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem SovietClient1, tvc(priormid econ_value_all capital_distance_ln regimeage_Vdem strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo sovclient_nodecol_excperln
estimates save "sovclient_nodecol_excperln", replace


**********
**********
//Table A.5 Endogeneity: GDP growth
**********
**********

stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

***//GDP -- Main result 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
*estat phtest, rank detail

*TVC needed (.1): regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc( regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_gdp
 estimates save "main_gdp", replace

***//GDP -- Group size 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem sum_tek_group_size_gain, shared(id) forceshared efron
estat phtest, rank detail


*TVC needed (.1): regimeage_Vdem  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem sum_tek_group_size_gain, tvc( regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo sum_tek_group_size_gain_gdp
 estimates save "sum_tek_group_size_gain_gdp", replace
 

***//GDP -- using historical elf (efindex)

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem efindex, shared(id) forceshared efron

estat phtest, rank detail
 
*TVC needed (.1):   priormid  regimeage_Vdem  efindex  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem efindex, tvc(priormid  regimeage_Vdem  efindex  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo EFIndex_nodecol_gdp_ws
 estimates save "EFIndex_nodecol_gdp_ws", replace

***//GDP -- Historical ELF sq. 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem efindex efindex_squared, shared(id) forceshared efron
estat phtest, rank detail
 
*TVC needed (.1):   priormid regimeage_Vdem efindex efindex_squared  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem efindex efindex_squared, tvc(priormid regimeage_Vdem efindex efindex_squared  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo EFIndex2_nodecol_gdp_ws
 estimates save "EFIndex2_nodecol_gdp_ws", replace

***//GDP -- Polarization 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem actv_groups_count_fill , shared(id) forceshared efron

estat phtest, rank detail

*TVC needed (.1): mid_current actv_groups_count_fill strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem actv_groups_count_fill, tvc(mid_current actv_groups_count_fill strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron
 eststo eprpolar_nodecol_gdp
 estimates save "eprpolar_nodecol_gdp", replace

***//GDP -- State capacity 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem statecapacitycomprehensive , shared(id) forceshared efron
estat phtest, rank detail

*tvc needed: capital_distance_ln regimeage_Vdem

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem statecapacitycomprehensive, tvc(capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron
 eststo cap_nodecol_gdp
 estimates save "cap_nodecol_gdp", replace

***//GDP -- New state

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem new_state_5_lose, shared(id) forceshared efron
estat phtest, rank detail
 
*TVC needed (.1): capital_distance_ln regimeage_Vdem  new_state_5_lose  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem new_state_5_lose, tvc(capital_distance_ln regimeage_Vdem  new_state_5_lose  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron
eststo newstate_nodecol_gdp_ws
estimates save "newstate_nodecol_gdp_ws", replace

***//GDP -- Clientelistic states 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100  econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem v2xnp_client, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):   regimeage_Vdem    strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem v2xnp_client, tvc(     regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron
 eststo clientelistic_nodecol_gdp
 estimates save "clientelistic_nodecol_gdp", replace

***//GDP -- Clients of same superpower 

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100  econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem ClientRelation3, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):   cincrat_updtd_clclpwr   regimeage_Vdem    strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem ClientRelation3, tvc(cincrat_updtd_clclpwr   regimeage_Vdem    strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo CR3_nodecol_gdp_ws
 estimates save "CR3_nodecol_gdp_ws", replace

***//GDP -- Clients ofopposing superpowers

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100  econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem ClientRelation4, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):   cincrat_updtd_clclpwr capital_distance_ln  regimeage_Vdem    strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem ClientRelation4, tvc(cincrat_updtd_clclpwr capital_distance_ln  regimeage_Vdem    strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo CR4_nodecol_gdp_ws
 estimates save "ClientRelation4_nodecol_gdp_ws", replace
 
***//GDP -- US client
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem USClient1,  shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):     regimeage_Vdem    strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem USClient1, tvc(  regimeage_Vdem   strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo USClient_nodecol_gdp_ws
 estimates save "USClient_nodecol_gdp_ws", replace

 
***//GDP -- Soviet client
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem SovietClient1,  shared(id) forceshared efron 
estat phtest, rank detail

*TVC needed (.1):    regimeage_Vdem SovietClient1   strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem SovietClient1, tvc( regimeage_Vdem SovietClient1   strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo SovietClient_nodecol_gdp_ws
 estimates save "SovietClient_nodecol_gdp_ws", replace


**************
**************
//Table A.6: Alternative explanations: Regime type

**************
**************


stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

***//Regime type -- Main result

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_aut
 estimates save "main_aut", replace

***//Regime type -- Exclude USSR

**needs new stset
stset time if potato_any_ModifiedEPR ==1 & loseccode!=365 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem , shared(id) forceshared efron
*estat phtest, rank detail

*TVC needed (.1):  priormid econ_value_all     strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc(  priormid econ_value_all     strata2 strata3 strata4up ) texp(ln(_t)) shared(id) forceshared efron
eststo soviet_nodecol
estimates save "soviet_nodecol" , replace

***//Regime type -- Group excluded

*go back to original stset
stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid  coethnic_presence_tek_mod poly_binary_dem1other0 coethnicXdemocracy econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem excluded, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid coethnic_presence_tek_mod econ_value_all  capital_distance_ln regimeage_Vdem excluded  strata2 strata3 strata4up

stcox mid_current priormid  coethnic_presence_tek_mod poly_binary_dem1other0 coethnicXdemocracy econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem excluded, tvc(priormid coethnic_presence_tek_mod econ_value_all  capital_distance_ln regimeage_Vdem excluded  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
eststo excluded_nodecol
estimates save "excluded_nodecol", replace

***//Regime type -- Self-determination movement

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem sdm, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):  priormid econ_value_all  capital_distance_ln  regimeage_Vdem   strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem sdm, tvc(priormid econ_value_all  capital_distance_ln  regimeage_Vdem   strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
eststo sdm_nodecol
estimates save "SDM_nodecol" , replace

***//Regime type -- Democratic dyad

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile dem_dyad strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail
 

*TVC needed (.01): priormid coethnicXdemocracy econ_value_all capital_distance_ln regimeage_Vdem

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile dem_dyad strata2 strata3 strata4up regimeage_Vdem, tvc(priormid coethnicXdemocracy econ_value_all capital_distance_ln regimeage_Vdem strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo dem_dyad_nodecol
estimates save "dem_dyad_nodecol", replace

***//Regime type -- Mutual security organization

stcox mid_current priormid coethnic_presence_tek_mod poly_binary_dem1other0 coethnicXdemocracy econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem mutual_defense_org , shared(id) forceshared efron

estat phtest, rank detail

*TVC needed (.1):  econ_value_all cincrat_updtd_clclpwr capital_distance_ln   regimeage_Vdem  strata2 strata3 strata4up

stcox mid_current priormid coethnic_presence_tek_mod poly_binary_dem1other0 coethnicXdemocracy econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem mutual_defense_org, tvc( econ_value_all cincrat_updtd_clclpwr capital_distance_ln   regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
eststo mutual_security_org_nodecol
estimates save "mutual_security_org_nodecol", replace


**************
**************
//Table A.7: Alternative explanations: Regime type

**************
**************

stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

***//Excluded proportion -- Main result

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_eth
 estimates save "main_eth", replace

***//Excluded proportion -- Exclude USSR

**needs new stset
stset time if potato_any_ModifiedEPR ==1 & loseccode!=365 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem , shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):  priormid cincrat_updtd_clclpwr    strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc(  priormid cincrat_updtd_clclpwr    strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron
eststo soviet_nodecol_excperln
estimates save "soviet_nodecol_excperln" , replace
 

***//Excluded proportion -- Group excluded

*go back to original stset
stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid  i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem excluded, shared(id) forceshared efron

estat phtest, rank detail


*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem excluded  strata2 strata3 strata4up

stcox mid_current priormid  i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem excluded, tvc(priormid econ_value_all capital_distance_ln regimeage_Vdem excluded  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
eststo excluded_nodecol_excperln_s
estimates save "excluded_nodecol_excperln_s", replace

***//Excluded proportion -- Self-determination movement

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem sdm, shared(id) forceshared efron
*estat phtest, rank detail

*TVC needed (.1):  priormid  econ_value_all  capital_distance_ln regimeage_Vdem   strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem sdm, tvc(priormid  econ_value_all  capital_distance_ln regimeage_Vdem   strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
eststo sdm_nodecol_excperln
estimates save "SDM_nodecol_excperln" , replace

***//Excluded proportion -- Democratic dyad

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem dem_dyad, shared(id) forceshared efron
estat phtest, rank detail
 

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem dem_dyad, tvc(priormid econ_value_all capital_distance_ln regimeage_Vdem strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo dem_dyad_nodecol_excperln
estimates save "dem_dyad_nodecol_excperln", replace

***//Excluded proportion -- Mutual security organization

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem mutual_defense_org , shared(id) forceshared efron
estat phtest, rank detail


*TVC needed (.1):   econ_value_all cincrat_updtd_clclpwr capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem mutual_defense_org, tvc( econ_value_all cincrat_updtd_clclpwr capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
eststo mutual_sec_nodecol_excperln
estimates save "mutual_sec_nodecol_excperln", replace



**************
**************
//Table A.8: Alternative explanations: Regime type

**************
**************
stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

***//GDP -- Main result

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
*estat phtest, rank detail

*TVC needed (.1): regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc( regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_gdp
 estimates save "main_gdp", replace

***//GDP -- Exclude USSR

**needs new stset
stset time if potato_any_ModifiedEPR ==1 & loseccode!=365 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem , shared(id) forceshared efron
estat phtest, rank detail
 
*TVC needed (.1):  priormid  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc(priormid strata2 strata3 strata4up ) texp(ln(_t)) shared(id) forceshared efron
eststo soviet_nodecol_gdp
estimates save "soviet_nodecol_gdp" , replace
 

***//GDP -- Group excluded

*go back to original stset
stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid  i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem excluded, shared(id) forceshared efron
estat phtest, rank detail
 
*TVC needed (.1): regimeage_Vdem excluded  strata2 strata3 strata4up

stcox mid_current priormid  i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem excluded, tvc(regimeage_Vdem excluded  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
eststo excluded_nodecol_gdp_ws
estimates save "excluded_nodecol_gdp_ws", replace

***//GDP -- Self-determination movement

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem sdm, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):  regimeage_Vdem  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem sdm, tvc(regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
eststo sdm_nodecol_gdp_ws
estimates save "SDM_nodecol_gdp_ws" , replace

***//GDP -- Democratic dyad

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem dem_dyad, shared(id) forceshared efron
estat phtest, rank detail
 
*TVC needed (.1):   regimeage_Vdem  strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem dem_dyad, tvc(regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo dem_dyad_nodecol_gdp_ws
estimates save "dem_dyad_nodecol_gdp_ws", replace

***//GDP -- Mutual security organization

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem mutual_defense_org , shared(id) forceshared efron
estat phtest, rank detail
 
*TVC needed (.1):   cincrat_updtd_clclpwr regimeage_Vdem strata2 strata3 strata4up

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem mutual_defense_org, tvc( cincrat_updtd_clclpwr  regimeage_Vdem strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
eststo mutual_sec_nodecol_gdp_ws
estimates save "mutual_sec_nodecol_gdp_ws", replace



***********
***********
//Table A.9: Additional alternative explanations: Regime type
***********
***********

***//Regime type -- Both Europe

stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem europe, shared(id) forceshared efron
estat phtest, rank detail


*TVC needed (.1):  priormid econ_value_all capital_distance_ln regimeage_Vdem    strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem europe, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo botheurope_aut
 estimates save "botheurope_aut", replace
 
***//Regime type -- Regional controls

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem i.region, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all region  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem i.region, tvc( priormid econ_value_all region  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo region_aut
 estimates save "region_aut", replace
 
***//Regime type -- Alternative ELF

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem elf, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid  regimeage_Vdem elf strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem elf, tvc( priormid  regimeage_Vdem elf  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo elf_aut
 estimates save "elf_aut", replace
 
***//Regime type -- Downgraded 10

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem downgraded10, shared(id) forceshared efron
estat phtest, rank detail


*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem downgraded10 strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem downgraded10, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem downgraded10 strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo downgraded10_aut
 estimates save "downgraded10_aut", replace
 
***//Regime type -- Excluded 10

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem downgraded_excl10, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem downgraded_excl10, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo downgraded_excl10_aut
 estimates save "downgraded_excl10_aut", replace
 
***//Regime type -- Post-communist

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem post_communist, shared(id) forceshared efron
estat phtest, rank detail

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem post_communist, tvc( priormid econ_value_all cincrat_updtd_clclpwr capital_distance_ln regimeage_Vdem post_communist strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase

 eststo postcom_aut
 estimates save "postcom_aut", replace
 
***//Regime type -- Imposed colonial border

 stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem imposed, shared(id) forceshared efron
estat phtest, rank detail

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem imposed, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem imposed strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase

 eststo imposed_aut
 estimates save "imposed_aut", replace
 
***********
***********
//Table A.10: Additional alternative explanations: Proportion excluded
***********
***********

***//Proportion excluded -- Both Europe

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem europe, shared(id) forceshared efron
estat phtest, rank detail


*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem europe, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo botheurope_eth
 estimates save "botheurope_eth", replace
 
***//Proportion excluded -- Regional controls

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem i.region, shared(id) forceshared efron
estat phtest, rank detail


*TVC needed (.1): priormid econ_value_all region  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem i.region, tvc( priormid econ_value_all region  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo region_eth
 estimates save "region_eth", replace
 
***//Proportion excluded -- Alternative ELF

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem elf, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid coethnicXln_losingstate_exclpop regimeage_Vdem elf  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem elf, tvc( priormid coethnicXln_losingstate_exclpop regimeage_Vdem elf strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo elf_eth
 estimates save "elf_eth", replace
 
***//Proportion excluded -- Downgraded 10

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem downgraded10, shared(id) forceshared efron
estat phtest, rank detail


*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem  downgraded10 strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem downgraded10, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem downgraded10  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo downgraded10_eth
 estimates save "downgraded10_eth", replace
 
***//Proportion excluded -- Excluded 10

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem downgraded_excl10, shared(id) forceshared efron
estat phtest, rank detail


*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem downgraded_excl10, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo downgraded_excl10_eth
 estimates save "downgraded_excl10_eth", replace
 
***//Proportion excluded -- Post-communist

stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem post_communist, shared(id) forceshared efron
estat phtest, rank detail
*/
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem post_communist, tvc( priormid econ_value_all cincrat_updtd_clclpwr capital_distance_ln regimeage_Vdem post_communist strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase

 eststo postcom_eth
 estimates save "postcom_eth", replace
 
***//Proportion excluded -- Imposed colonial border
 stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem imposed, shared(id) forceshared efron
estat phtest, rank detail

stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem imposed, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem imposed strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo imposed_eth
 estimates save "imposed_eth", replace

***********
***********
//Table A.11: Additional alternative explanations: GDP growth 
***********
***********

***//GDP -- Both Europe

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem europe, shared(id) forceshared efron
estat phtest, rank detail


*TVC needed (.1): capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem europe, tvc( capital_distance_ln regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo botheurope_gdp
 estimates save "botheurope_gdp", replace
 
***//GDP -- Regional controls

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem i.region, shared(id) forceshared efron
estat phtest, rank detail


*TVC needed (.1): econ_value_all cincrat_updtd_clclpwr regimeage_Vdem region  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem i.region, tvc( econ_value_all cincrat_updtd_clclpwr regimeage_Vdem region  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo region_gdp
 estimates save "region_gdp", replace
 
***//GDP -- Alternative ELF

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem elf, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): regimeage_Vdem elf strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem elf, tvc( regimeage_Vdem elf strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo elf_gdp
 estimates save "elf_gdp", replace
 
***//GDP -- Downgraded 10

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem downgraded10, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem downgraded10, tvc( regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo downgraded10_gdp
 estimates save "downgraded10_gdp", replace
 
***//GDP -- Excluded 10

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem downgraded_excl10, shared(id) forceshared efron
estat phtest, rank detail
*/

*TVC needed (.1): regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem downgraded_excl10, tvc( regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo downgraded_excl10_gdp
 estimates save "downgraded_excl10_gdp", replace
 
***//GDP -- Post-communist

stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem post_communist, shared(id) forceshared efron
estat phtest, rank detail
*/
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem post_communist, tvc(cincrat_updtd_clclpwr capital_distance_ln regimeage_Vdem post_communist strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo postcom_gdp
 estimates save "postcom_gdp", replace


***//GDP -- Imposed colonial border
 stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem imposed, shared(id) forceshared efron
estat phtest, rank detail

stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem imposed, tvc( regimeage_Vdem imposed strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo imposed_gdp
 estimates save "imposed_gdp", replace
 
 
 
 
***************
***************
//Table A.12: Variation by type of authoritarian regime, based on Geddes et al.(2014)
****************
****************

stcox mid_current priormid coethnic_presence_tek_mod##i.loseccode_gwf_party_binary econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed:  regimeage_Vdem

stcox mid_current priormid i.coethnic_presence_tek_mod##i.loseccode_gwf_party_binary econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc( regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

 eststo gwf_party
 estimates save "gwf_party", replace
 
 
 
 stcox mid_current priormid coethnic_presence_tek_mod##i.loseccode_gwf_nonparty_binary econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed: priormid econ_value_all capital_distance_ln regimeage_Vdem  regimeage_Vdem


stcox mid_current priormid i.coethnic_presence_tek_mod##i.loseccode_gwf_nonparty_binary econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem  regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

 eststo gwf_nonparty
 estimates save "gwf_nonparty", replace
 
 
 
 
 
***************
***************
//Table A.13: Robustness to controlling for pre- and post-1990
***************
***************

* regime type
stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem post1990, shared(id) forceshared efron
estat phtest, rank detail
beep

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem post1990 strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem post1990, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem post1990 strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase

 eststo main_aut_1990
 estimates save "main_aut_1990", replace


*proportion excluded
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem post1990, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem post1990  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem post1990, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem post1990 strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_eth_1990
 estimates save "main_eth_1990", replace


*gdp growth
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem post1990, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): regimeage_Vdem  post1990 strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem post1990, tvc( regimeage_Vdem  post1990 strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_gdp_1990
 estimates save "main_gdp_1990", replace

 
 

 ****************
 ****************
 //Table A.14: Robustness to controlling for cause of border division
 ****************
 ****************
 
 //Cause = War

* regime type
stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem borderoriginwar, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem borderoriginwar strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem borderoriginwar, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem borderoriginwar strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_aut_war
 estimates save "main_aut_war", replace

*proportion excluded
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem borderoriginwar, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem borderoriginwar  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem borderoriginwar, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem borderoriginwar strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_eth_war
 estimates save "main_eth_war", replace


*gdp growth
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem borderoriginwar, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): regimeage_Vdem borderoriginwar  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem borderoriginwar, tvc( regimeage_Vdem  borderoriginwar strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_gdp_war
 estimates save "main_gdp_war", replace
 
 
 //Cause = legal origin

* regime type
stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem legalborderorigin, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem legalborderorigin  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem legalborderorigin strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_aut_legal
 estimates save "main_aut_legal", replace

*proportion excluded
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem legalborderorigin, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid econ_value_all capital_distance_ln regimeage_Vdem legalborderorigin  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem legalborderorigin, tvc( priormid econ_value_all capital_distance_ln regimeage_Vdem legalborderorigin strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_eth_legal
 estimates save "main_eth_legal", replace


*gdp growth
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem legalborderorigin, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): regimeage_Vdem  strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem legalborderorigin, tvc( regimeage_Vdem  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_gdp_legal
 estimates save "main_gdp_legal", replace
 
 
**************
**************
//Table A.15: Sensitivity Analysis (VanderWeele & Ding, 2017)
**************
**************

** ssc install evalue (if you don't already have it)
evalue hr .0571, common
evalue hr 1.1405, common
evalue hr 0.8682, common



**************
**************
//Table A.19: Risk of applying homeland territoriality to lost lands: Strict EPR
**************
**************

stset time if potato_any_strictEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)


* regime type

stcox mid_current priormid i.coethnic_presence_tek##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*tvc needed (.1): 	priormid coethnicXdemocracy econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile regimeage_Vdem					strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem , tvc(priormid coethnicXdemocracy econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile regimeage_Vdem	 strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_aut_strict
 estimates save "main_aut_strict", replace

*proportion excluded
*stcox mid_current priormid i.coethnic_presence_tek##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
*estat phtest, rank detail

*tvc needed (.1): 	priormid econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile regimeage_Vdem					strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem , tvc( priormid econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile regimeage_Vdem	strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_eth_strict
 estimates save "main_eth_strict", replace


*gdp growth
stcox mid_current priormid i.coethnic_presence_tek##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*tvc needed (.1): 		cincrat_updtd_clclpwr regimeage_Vdem				strata2 strata3 strata4up
stcox mid_current priormid i.coethnic_presence_tek##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem , tvc(cincrat_updtd_clclpwr regimeage_Vdem	 strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_gdp_strict
 estimates save "main_gdp_strict", replace
 

 
**************
**************
//Table A:20 Risk of applying homeland territoriality to lost lands: Regime type (alternative regime type classifications)
**************
**************

*** POLITY IV 
stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##c.polity2_dem econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up polity_age , shared(id) forceshared efron

estat phtest, rank detail

*TVC needed (.1): coethnic_presence_tek_mod  econ_value_all cincrat_updtd_clclpwr capital_distance_ln  polity_age  strata2 strata3 strata4up

stcox mid_current priormid coethnic_presence_tek_mod polity2_dem coethnicXpolity2 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up polity_age , tvc(coethnic_presence_tek_mod  econ_value_all cincrat_updtd_clclpwr capital_distance_ln  polity_age  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron

eststo robust_polity6_nodecol
estimates save "robust_polity6_nodecol", replace

*** Continuous VDEM measure
stcox mid_current priormid i.coethnic_presence_tek_mod##c.v2x_polyarchy_NEW econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regime_age_continuos , shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): v2x_polyarchy_NEW  econ_value_all cincrat_updtd_clclpwr capital_distance_ln regime_age_continuos     strata2 strata3 strata4up

stcox mid_current priormid coethnic_presence_tek_mod  v2x_polyarchy_NEW  coethnicXvdem_continuous econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_Vdem, tvc(v2x_polyarchy_NEW  econ_value_all cincrat_updtd_clclpwr capital_distance_ln regime_age_continuos     strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron	 

eststo robust_polyarchy_nodecol
estimates save "robust_polyarchy_nodecol", replace

*** Robustness to coding competitive authoritarian as democracy
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_aut0other1 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_aut0other1 , shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid coethnic_presence_tek_mod econ_value_all cincrat_updtd_clclpwr capital_distance_ln  strata2 strata3 strata4up

stcox mid_current priormid coethnic_presence_tek_mod poly_binary_aut0other1 coethnicXdem_aut0other1 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4up regimeage_aut0other1, tvc(priormid coethnic_presence_tek_mod econ_value_all cincrat_updtd_clclpwr capital_distance_ln  strata2 strata3 strata4up) texp(ln(_t)) shared(id) forceshared efron 

eststo alt_dem_code_nodecol
estimates save "alt_dem_code_nodecol", replace


 
***********
***********
*See separate do-file for code to Figure A.2
***********
***********


**************
**************
//Table A.21: Risk of applying homeland territoriality to lost lands: Different strata cut points
**************
**************

//Bundle strata 3 and up
* regime type
stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1): priormid coethnicXdemocracy econ_value_all capital_distance_ln regimeage_Vdem       strata2 strata3up
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3up regimeage_Vdem, tvc(  priormid coethnicXdemocracy econ_value_all capital_distance_ln regimeage_Vdem  strata2 strata3up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_aut_3up
 estimates save "main_aut_3up", replace

*Proportion excluded
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):   priormid econ_value_all capital_distance_ln regimeage_Vdem     strata2 strata3up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3up regimeage_Vdem, tvc(  priormid econ_value_all capital_distance_ln regimeage_Vdem   strata2 strata3up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_eth_3up
 estimates save "main_eth_3up", replace


*gdp growth
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):     regimeage_Vdem   strata2 strata3up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3up regimeage_Vdem, tvc( regimeage_Vdem   strata2 strata3up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_gdp_3up
 estimates save "main_gdp_3up", replace
 beep 

//bundle strata 5 and up 

* regime type
stset time if potato_any_ModifiedEPR ==1 & colony==0, failure(homeland) exit(time .) origin(time0_minus1) id(id)

stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4 strata5up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):   priormid econ_value_all capital_distance_ln regimeage_Vdem      strata2 strata3 strata4 strata5up
stcox mid_current priormid i.coethnic_presence_tek_mod##i.poly_binary_dem1other0 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4 strata5up regimeage_Vdem, tvc(priormid econ_value_all capital_distance_ln regimeage_Vdem   strata2 strata3 strata4 strata5up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_aut_5up
 estimates save "main_aut_5up", replace
 
 
*Proportion excluded
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4 strata5up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):    priormid capital_distance_ln regimeage_Vdem     strata2 strata3 strata4 strata5up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.ln_losingstate_exclpop econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4 strata5up regimeage_Vdem, tvc(priormid capital_distance_ln regimeage_Vdem  strata2 strata3 strata4 strata5up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_ethn_5up
 estimates save "main_ethn_5up", replace

 
*gdp growth
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4 strata5up regimeage_Vdem, shared(id) forceshared efron
estat phtest, rank detail

*TVC needed (.1):   regimeage_Vdem      strata2 strata3 strata4 strata5up
stcox mid_current priormid i.coethnic_presence_tek_mod##c.gdpgrowth100 econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile strata2 strata3 strata4 strata5up regimeage_Vdem, tvc(  regimeage_Vdem  strata2 strata3 strata4 strata5up) texp(ln(_t)) shared(id) forceshared efron allbase
 eststo main_gdp_5up
 estimates save "main_gdp_5up", replace
 
 
***************
***************
//Table A.22: Robustness to modeling with cubic splines
***************
***************

//load new data
use "cubic splines data.dta"

xtset id year 

//democracy_Vdem==1 means democracy 
xtpoisson homeland_0 mid_current priormid i.coethnic_presence_tek_mod econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile_new regime_age_vdem_binary  years_since_last_failure years_since_last_failure2 years_since_last_failure3 if potato_any_ModifiedEPR ==1 & democracy_Vdem==1 & colony==0, vce(robust)
eststo cubic_poisson_dem

//democracy_Vdem==0 means autocracy
xtpoisson homeland_0 mid_current priormid i.coethnic_presence_tek_mod econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile_new regime_age_vdem_binary years_since_last_failure years_since_last_failure2 years_since_last_failure3 if potato_any_ModifiedEPR ==1 & democracy_Vdem==0, vce(robust)
eststo cubic_poisson_aut

xtpoisson homeland_0 mid_current priormid i.coethnic_presence_tek_mod econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile_new regime_age_vdem_binary years_since_last_failure years_since_last_failure2 years_since_last_failure3 if potato_any_ModifiedEPR ==1 & ln_losingstate_exclpop_tv>-2.65, vce(robust)
eststo cubic_poisson_exclpop_high

xtpoisson homeland_0 mid_current priormid i.coethnic_presence_tek_mod econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile_new regime_age_vdem_binary years_since_last_failure years_since_last_failure2 years_since_last_failure3 if potato_any_ModifiedEPR ==1 &ln_losingstate_exclpop_tv<=-2.65, vce(robust)
eststo cubic_poisson_exclpop_low

xtpoisson homeland_0 mid_current priormid i.coethnic_presence_tek_mod econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile_new regime_age_vdem_binary years_since_last_failure years_since_last_failure2 years_since_last_failure3 if potato_any_ModifiedEPR ==1 & gdp_pos==0, vce(robust)
eststo cubic_poisson_gdp_neg

xtpoisson homeland_0 mid_current priormid i.coethnic_presence_tek_mod econ_value_all cincrat_updtd_clclpwr capital_distance_ln global_qtile_new regime_age_vdem_binary years_since_last_failure years_since_last_failure2 years_since_last_failure3 if potato_any_ModifiedEPR ==1 & gdp_pos==1, vce(robust)
eststo cubic_poisson_gdp_pos

esttab cubic_poisson_aut cubic_poisson_dem  cubic_poisson_exclpop_high cubic_poisson_exclpop_low cubic_poisson_gdp_neg cubic_poisson_gdp_pos using cubic_nodecol_april_50v2.tex , replace label  unstack eform  wrap nodep booktabs nogaps se(3) star($^\dagger$ 0.10 * 0.05 ** 0.01 *** 0.001)  
